package com.kuang.service;

import com.kuang.dao.ProductMapper;
import com.kuang.pojo.Product;

import java.util.List;

public class ProductServiceImpl  implements ProductService{
    private ProductMapper productMapper;

    public void setProductMapper(ProductMapper productMapper) {
        this.productMapper = productMapper;
    }

    @Override
    public List<Product> getProduct() {
        return productMapper.getProduct();
    }

    @Override
    public int addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public Product getProductById(int id) {
        return productMapper.getProductById(id);
    }

    @Override
    public int updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public List<Product> queryProductByName(String name) {
        return productMapper.queryProductByName(name);
    }

    @Override
    public int deleteProduct(int id) {
        return productMapper.deleteProduct(id);
    }

    @Override
    public int updateById(Product product) {
        return productMapper.updateById(product);
    }

    @Override
    public List<String> namebyProduct() {
        return productMapper.namebyProduct();
    }

    @Override
    public String productbyname(String name) {
        return productMapper.productbyname(name);
    }

    @Override
    public int productidbyname(String name) {
        return productMapper.productidbyname(name);
    }

    @Override
    public int updatensjbyid(Product product) {
        return productMapper.updatensjbyid(product);
    }
}
